/*
 * MainFrame.java
 *
 * Created on 3-Mar-2009, 1:49:43 PM
 */
package display;

import physics.*;

/**
 *
 * @author peter
 */
public class MainFrame extends javax.swing.JFrame {
	Display display_;
	Engine e;

	/** Creates new form MainFrame */
	public MainFrame() {
		initComponents();

		display_ = new Display();
		e = new Engine(display_);
		mainPanel.add(display_);
		
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    private void initComponents() {//GEN-BEGIN:initComponents

        mainPanel = new javax.swing.JPanel();
        toolPanel = new javax.swing.JPanel();
        magicButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS));

        mainPanel.setLayout(new java.awt.BorderLayout());
        getContentPane().add(mainPanel);

        toolPanel.setLayout(new javax.swing.BoxLayout(toolPanel, javax.swing.BoxLayout.LINE_AXIS));

        magicButton.setText("Magic");
        magicButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                magicButtonActionPerformed(evt);
            }
        });
        toolPanel.add(magicButton);

        getContentPane().add(toolPanel);

        pack();
    }//GEN-END:initComponents

	private void magicButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_magicButtonActionPerformed
		e.start();
}//GEN-LAST:event_magicButtonActionPerformed


	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		MainFrame mf = new MainFrame();
		mf.setSize(600, 600);
		mf.setVisible(true);
	}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton magicButton;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JPanel toolPanel;
    // End of variables declaration//GEN-END:variables
}
